*The Politics of Ethnic Identity in Sub-Saharan Africa by Elliott D. Green*
*Comparative Political Studies*
*Replication Files: Use 'PEISSA CPS Final.dta' file unless indicated*

**Table 1**
tab year if country=="Benin" & round!=.
summarize Wsurveytotal percfw if country=="Benin" & round!=.
summarize percfw if country=="Benin" & round!=. & president==1
tab year if country=="CAR" & round!=.
summarize Wsurveytotal percfw if country=="CAR" & round!=.
summarize percfw if country=="CAR" & round!=. & president==1
tab year if country=="Cote d'Ivoire" & round!=.
summarize Wsurveytotal percfw if country=="Cote d'Ivoire" & round!=.
summarize percfw if country=="Cote d'Ivoire" & round!=. & president==1
tab year if country=="Ghana" & round!=.
summarize Wsurveytotal percfw if country=="Ghana" & round!=.
summarize percfw if country=="Ghana" & round!=. & president==1
tab year if country=="Guinea" & round!=.
summarize Wsurveytotal percfw if country=="Guinea" & round!=.
summarize percfw if country=="Guinea" & round!=. & president==1
tab year if country=="Kenya" & round!=.
summarize Wsurveytotal percfw if country=="Kenya" & round!=.
summarize percfw if country=="Kenya" & round!=. & president==1
tab year if country=="Liberia" & round!=.
summarize Wsurveytotal percfw if country=="Liberia" & round!=.
summarize percfw if country=="Liberia" & round!=. & president==1
tab year if country=="Malawi" & round!=.
summarize Wsurveytotal percfw if country=="Malawi" & round!=.
summarize percfw if country=="Malawi" & round!=. & president==1
tab year if country=="Mali" & round!=.
summarize Wsurveytotal percfw if country=="Mali" & round!=.
summarize percfw if country=="Mali" & round!=. & president==1
tab year if country=="Niger" & round!=.
summarize Wsurveytotal percfw if country=="Niger" & round!=.
summarize percfw if country=="Niger" & round!=. & president==1
tab year if country=="Nigeria" & round!=.
summarize Wsurveytotal percfw if country=="Nigeria" & round!=.
summarize percfw if country=="Nigeria" & round!=. & president==1
tab year if country=="Senegal" & round!=.
summarize Wsurveytotal percfw if country=="Senegal" & round!=.
summarize percfw if country=="Senegal" & round!=. & president==1
tab year if country=="Tanzania" & round!=.
summarize Wsurveytotal percfw if country=="Tanzania" & round!=.
summarize percfw if country=="Tanzania" & round!=. & president==1
tab year if country=="Zambia" & round!=.
summarize Wsurveytotal percfw if country=="Zambia" & round!=.
summarize percfw if country=="Zambia" & round!=. & president==1

summarize Wsurveytotal percfw if round!=. & percfw!=.
summarize percfw if round!=. 
summarize percfw if round!=. & president==1

**Table 2**
xtset EGid
*Using country-ethnic group and round fixed effects
xtreg percfw president hrfw i.round, fe cluster (EGid)
xtreg percfw president PinteractionPolityIV PolityNorm hrfw i.round, fe cluster (EGid)
*country-round FE
xtreg percfw president PinteractionPolityIV PolityNorm hrfw CountryID##round, fe cluster (EGid)
*related groups
xtreg percfw president PinteractionPolityIV PolityNorm RelatedL RelatedInt hrfw i.round, fe cluster (EGid)
*Mixed Effects model
xtmixed percfw AvPresident presidentmm PPolityInteraction4mm PolityNorm Avhrfw hrfwmm French if round!=. || CountryID: || EGid: , nolog
*lagged dependent variable
reg percfw president PinteractionPolityIV PolityNorm hrfw lagw1 if round!=., vce (cluster EGid)
*lead5
xtreg percfw presidentlead5 PPolityInteraction5lead PolityNorm hrfw i.round, fe cluster (EGid)

*Table 3: Zambia 2001 Survey [Use 'Zambia 2001 CPS Final.dta']
logit Bemba PostElection age agesq Male Rural Education Catholic Unemployed region6 if TwoMonths==1, vce (cluster ClusterN)
logit HomeLanguage2 PostElection age agesq Male Rural Education Catholic Unemployed region6 if TwoMonths==1, vce (cluster ClusterN)
logit InterviewLanguage2 PostElection age agesq Male Rural Education Catholic Unemployed region6 if TwoMonths==1, vce (cluster ClusterN)
logit LenTon PostElection age agesq Male Rural Education Catholic Unemployed region8 if TwoMonths==1, vce (cluster ClusterN)
logit Nyanja PostElection age agesq Male Rural Education Catholic Unemployed region3 if TwoMonths==1, vce (cluster ClusterN)
logit HomeLanguage7 PostElection age agesq Male Rural Education Catholic Unemployed region3 if TwoMonths==1, vce (cluster ClusterN)
logit InterviewLanguage7 PostElection age agesq Male Rural Education Catholic Unemployed region3 if TwoMonths==1, vce (cluster ClusterN)

*Table 4: Using Sub-Samples
*Presidents' Home Regions Only
xtreg PresidentHRall president PinteractionPolityIV PolityNorm hrfw i.round, fe cluster (EGid)
*Excluding Presidents' Home Regions
xtreg OutsidePRHRall president PinteractionPolityIV PolityNorm hrfw i.round, fe cluster (EGid)
*Unemployed Women only
xtreg Unemployed president PinteractionPolityIV PolityNorm hrfw i.round, fe cluster (EGid)
*Employed Women only
xtreg Employed president PinteractionPolityIV PolityNorm hrfw i.round, fe cluster (EGid)


*Appendices
*A.2. Correlates of inclusion within the dataset [use 'DHS Country data.dta']
ttest bridummy, by(DHS2)
ttest fearon , by(DHS2)
ttest latlog , by(DHS2)
ttest km2log , by(DHS2)
ttest GDP8616av , by(DHS2)
ttest Polity8616 , by(DHS2)
ttest Polity8616 , by(dhs2total)

*Table A.4: Additional Robustness tests
*All country data (multiple surveys per round)
xtreg percfw president PinteractionPolityIV PolityNorm hrfw i.year, fe cluster (EGid)
*Only surveys either side of regime change
xtreg percfw president PinteractionPolityIV PolityNorm hrfw i.round if chss==1, fe cluster (EGid)
*Religious Transitions [use 'Religion Transition.dta']
xtreg percfw PolityInt president PolityNorm i.round, fe cluster (Rid)
*men only including age 20-49 with minimum of 2000 per survey
xtreg percm2049w president PinteractionPolityIV PolityNorm hrmfw i.round if MSurvey2049w2000==1, fe cluster (EGid)
*mf together: only including age 15-49 for both genders
xtreg percmf1549w president PinteractionPolityIV PolityNorm hrmfw i.round , fe cluster (EGid)

*A.5. Only one country at a time
xtreg percfw president hrfw i.round if country=="Benin", fe cluster (EGid)
xtreg percfw president hrfw i.round if country=="CAR", fe cluster (EGid)
xtreg percfw president hrfw i.round if country=="Cote d'Ivoire", fe cluster (EGid)
xtreg percfw president hrfw i.round if country=="Ghana", fe cluster (EGid)
xtreg percfw president hrfw i.round if country=="Guinea", fe cluster (EGid)
xtreg percfw president hrfw i.round if country=="Kenya", fe cluster (EGid)
xtreg percfw president hrfw i.round if country=="Liberia", fe cluster (EGid)
xtreg percfw president hrfw i.round if country=="Malawi", fe cluster (EGid)
xtreg percfw president hrfw i.round if country=="Mali", fe cluster (EGid)
xtreg percfw president hrfw i.round if country=="Niger", fe cluster (EGid)
xtreg percfw president hrfw i.round if country=="Nigeria", fe cluster (EGid)
xtreg percfw president hrfw i.round if country=="Senegal", fe cluster (EGid)
xtreg percfw president hrfw i.round if country=="Tanzania", fe cluster (EGid)
xtreg percfw president hrfw i.round if country=="Zambia", fe cluster (EGid)

*A.6: Alternative Measures of Democracy
*Freedom House continuous
xtreg percfw president FHContInt FreedomHouse hrfw i.round , fe cluster (EGid)
*FOTP (only available from 1993 - hence no variation in Liberia and Tanzania)
xtreg percfw president FOTPInt FOTP hrfw i.round if country!="Liberia" & country!="Tanzania", fe cluster (EGid)
*polyarchy, binary and continuous
xtreg percfw president PAContInt polyarchycont hrfw i.round , fe cluster (EGid)
*Ahlerup and Isaksson (2015) country-level coefficients
xtreg percfw president AIint hrfw i.round , fe cluster (EGid)

*A.7: Testing for Sampling within regions across time [use 'DHS Regions 2020.dta']
*Testing for proportion of sample in president's home region or in ethnic group's home region
xtreg percfw president round, fe cluster (RegionID)
xtreg percfw PEGhomeregion round, fe cluster (RegionID)
*Testing for overall response rate (=household * eligible woman response rate)
xtreg ORR president round, fe cluster (RegionID)
xtreg ORR PEGhomeregion round, fe cluster (RegionID)

*A.8. Additional robustness tests
xtreg percfw president PinteractionPolityIV PolityNorm hrfw neighbourp i.round, fe cluster (EGid)
xtreg percfw president PinteractionPolityIV PolityNorm hrfw PGDPinteraction logGDPpc i.round, fe cluster (EGid)
xtreg percfw president PinteractionPolityIV PolityNorm hrfw Schoolint TotalEducation i.round, fe cluster (EGid)
xtreg percfw president PinteractionPolityIV PolityNorm hrfw SHInt i.round, fe cluster (EGid)
xtreg percfw president PinteractionPolityIV PolityNorm hrfw PELFinteration i.round, fe cluster (EGid)
xtreg percfw president PinteractionPolityIV PolityNorm hrfw DesmetInt i.round, fe cluster (EGid)
xtreg percfw president PinteractionPolityIV PolityNorm hrfw PImarriageInteraction imarriage i.round, fe cluster (EGid)

*Table A9: Zambia Effects driven by Central, Eastern and Northern Provinces [Use 'Zambia 2001 CPS Final.dta']
*In Eastern, Central and Northern Provinces only
logit Bemba PostElection age agesq Male Rural Education Catholic Unemployed region6 if TwoMonths==1 & CEN ==1, vce (cluster ClusterN)
logit HomeLanguage2 PostElection age Male Rural Education Catholic region6 if TwoMonths==1 & CEN==1, vce (cluster ClusterN)
logit Nyanja PostElection age agesq Male Rural Education Catholic Unemployed region3 if TwoMonths==1 & CEN ==1, vce (cluster ClusterN)
logit HomeLanguage7 PostElection age Male Rural Education Catholic region3 if TwoMonths==1 & CEN==1, vce (cluster ClusterN)
*Excluding Eastern, Central and Northern Provinces
logit Bemba PostElection age agesq Male Rural Education Catholic Unemployed region6 if TwoMonths==1 & CEN ==0, vce (cluster ClusterN)
logit HomeLanguage2 PostElection age Male Rural Education Catholic region6 if TwoMonths==1 & CEN==0, vce (cluster ClusterN)
logit Nyanja PostElection age agesq Male Rural Education Catholic Unemployed region3 if TwoMonths==1 & CEN ==0, vce (cluster ClusterN)
logit HomeLanguage7 PostElection age Male Rural Education Catholic region3 if TwoMonths==1 & CEN==0, vce (cluster ClusterN)

*Figure A1
twoway (scatter switching Ahlerup6, mlabel(country))

*Figure A2
twoway (scatter switching HandR, mlabel(country))
